<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title></title>
  <!-- Fix for iOS Safari zooming bug -->
  <meta name="viewport"
    content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
  <meta charset="utf-8" />
  <!--script src="./pako.js"></script-->
  <!--封装了一个发布订阅模式-->
  <script src="./event.js"></script>
  <!--websocket-->
  <script src="./websocket.js"></script>
  <!--图表库js-->
  <script src="./charting_library/charting_library.min.js"></script>
  <!--script src="./tradingview-master/charting_library/charting_library.js"></script-->
  <!--图表数据获取-->
  <script src="./datafeed.js"></script>
  <!--图表配置-->
  <script src="./chartConfig.js"></script>
</head>
<style>
  * {
    padding: 0;
    margin: 0;
  }

  body {
    height: 100%;
    background-color: #fff;
  }

  /* 这个下面的css是 产品周期按钮的 */

  .header {
    position: relative;
    height: 32vh;
    box-shadow: 0px 4px 2px #fff;
  }

  .times {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
  }

  .times span {
    margin-right: 1px;
    /* width: 42px; */
    flex: 1;
    height: 25px;
    flex-shrink: 0;
    line-height: 25px;
    color: #f3a630;
    font-size: 14px;
    text-align: center;
    border-radius: 2px;
  }

  .times span.active {
    color: #fff;
    background-color: #f3a630;
  }

  /* 	#tv_chart_container:before {
		content: " ";
		position: fixed;
		bottom: 22%;
		left: 5%;
		z-index: 999;
		width: 9vw;
		height: 9vw;
		background-color: #fff;
	} */
  /* 这个下面的css重点关注，和k线图与关 */
  #tv_chart_container {
    width: 100%;
    height: 68vh;
  }

  iframe {
    width: 100%;
    height: 100% !important;

  }

  .pane-legend-line.pane-legend-wrap.main.expand-line {
    padding-right: 5px;
  }

  .detail {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
  }

  .detail .u {
    font-size: 24px;
    color: #1cad90;
    font-weight: bold;
  }

  .detail .c {
    font-size: 13px;
    color: #1cad90;
    margin-top: 5px;
  }

  .detail .c .change {
    color: #1cad90;
    margin-left: 10px;
  }

  .detail .left {
    padding: 0 0 7px;
  }

  .detail .right {
    width: 61%;
    flex-shrink: 0;
  }

  .detail .right .i {
    margin: 10px 0 0 10px;
    width: 40%;
    display: flex;
    flex-shrink: 0;
    flex-direction: column;
    /* align-items: center; */
    color: #000;
    font-size: 16px;
  }

  .detail .right .flex {
    display: flex;
    justify-content: space-between;
  }

  .detail .right .i span {
    margin-top: 3px;
    font-weight: 700;
  }

  .detail .right .i label {
    font-size: 12px;
  }

  .detail .t {
    color: #000;
  }

  .right .t {
    text-align: left;
  }

  @media screen and (max-width: 375px) {
    .detail {
      padding: 0 10px;
    }
  }

  @media screen and (max-width: 340px) {
    .header {
      height: 36vh;
    }

    #tv_chart_container {
      width: 100%;
      height: 61vh;
    }
  }
</style>

<body>
  <div class="root">
    <div class="header">
      <div class="detail">
        <div class="left">
          <!-- <div class="t">当前</div> -->
          <div class="u" id="close">0.00</div>
          <div class="c"><span id="cny">0.00 </span><span id="change" class="change">+0.0%</span></div>
        </div>
        <div class="right">
          <div class="flex">
            <div class="i"><label id="opening" class="t">开盘</label><span id="open">0.00</span></div>
            <div class="i"><label id="volume" class="t">成交量</label><span id="amount">0.00</span></div>
          </div>
          <!-- <span id="wan">万</span> -->
          <div class="flex">
            <div class="i"><label id="lowest" class="t">最低</label><span id="low">0.00</span></div>
            <div class="i"><label id="highest" class="t">最高</label><span id="high">42400.00</span></div>
          </div>
        </div>
      </div>
      <div class="times" id="interval">
        <span data-value="2">Time</span>
        <span data-value="1" class="active">1M</span>
        <span data-value="5">5M</span>
        <span data-value="15">15M</span>
        <span data-value="30">30M</span>
        <span data-value="60">1H</span>
        <span data-value="1D">1D</span>
        <span data-value="7W">7W</span>
      </div>
    </div>
    <div class="chart">
      <div id="tv_chart_container"></div>
    </div>
  </div>
  <script type="text/javascript" src="https://js.cdn.aliyun.dcloud.net.cn/dev/uni-app/uni.webview.1.5.2.js"></script>
  <script type="text/javascript">
    function plusReady() {
      var ws = plus.webview.currentWebview();
      ws.overrideUrlLoading({
        mode: 'reject'
      }, function (e) {
        console.log('拦截跳转 url: ' + e.url);
      })
    }
    document.addEventListener('plusready', plusReady, false);

    if (window.UniAppJSBridge) {
    } else {
      document.addEventListener('UniAppJSBridgeReady', function () {

      });
    }
  </script>
  <!--页面总统js 初始化图表库 绑定点击事件等-->
  <script src="./index.js"></script>

</body>

</html>